#!/bin/bash
#
# Misc utilities


unit-tests() {
  PYTHONPATH=$PWD find . -name \*test.py | sh -e -x
}

unit() {
  PYTHONPATH=. "$@"
}

example() {
  # this fails
  PYTHONPATH=. examples/taste_example_test.py
}

wc() {
  find . -name \*.py | xargs wc -l "$@" | sort -n
}

# separate shell script
deploy-sh() {
  # replace Tree.cfg?
  cp -v taste.sh ~/git/container-tools/_tmp/deps/
}

find-sh-users() {
  grep taste-main \
    ~/git/*/*.sh \
    ~/git/*/*/*.sh \
    ~/hg/*/*.sh \
    ~/hg/*/*/*.sh
}

# Files that should be using taste.
find-sh-tests() {
  ls \
    ~/git/*/*-test.sh \
    ~/git/*/*/*-test.sh \
    ~/hg/*/*-test.sh \
    ~/hg/*/*/*-test.sh
}

"$@"
